#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cmath>


using namespace std;


int GetMonth(int year, int month)
{
    int a[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
    if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)))
        a[month] = 29;
    return a[month];
}


int main()
{
    int year1, month1, day1;
    int year2, month2, day2;
    scanf("%4d%2d%2d", &year1, &month1, &day1);
    scanf("%4d%2d%2d", &year2, &month2, &day2);

    for (int i = 1; i <= month1 - 1 || i <= month2 - 1; i++)
    {
        if (i <= month1 - 1)
            day1 += GetMonth(year1, i);
        if (i <= month2 - 1)
            day2 += GetMonth(year2, i);
    }


    int gapday = abs(day1 - day2) + 1;

    int max = year1, min = year2;
    if (year1 < year2)
    {
        max = year2;
        min = year1;
    }
    int gapyear = (max - min) * 365;
    for (int i = min; i < max; i++)
    {
        if ((i % 4 == 0 && i % 100 != 0) || (i % 400 == 0))
            gapyear += 1;
    }


    cout << (gapyear + gapday) << endl;


    return 0;
}
